package com.cheese.crowd;

import com.cheese.crowd.entity.admin;
import com.cheese.crowd.mapper.adminMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring-persist-mybatis.xml","classpath:spring-persist-service.xml"})
public class CrowdTest {

    @Autowired
    private adminMapper adminMapper;

    @Test
    public void test(){
        admin admin = new admin(null, "sea", "123456", "海洋", "thecheesesea@163.com", null);
        adminMapper.insert(admin);
    }

//    @Test
//    public void test(){
//        Logger logger = LoggerFactory.getLogger(CrowdTest.class);
//        logger.debug("这里是debug级别！！！");
//        logger.debug("这里是debug级别！！！");
//        logger.debug("这里是debug级别！！！");
//
//        logger.info("这里是info级别！！！");
//        logger.info("这里是info级别！！！");
//        logger.info("这里是info级别！！！");
//
//        logger.warn("这里是warn级别！！！");
//        logger.warn("这里是warn级别！！！");
//        logger.warn("这里是warn级别！！！");
//
//        logger.error("这里是error级别！！！");
//        logger.error("这里是error级别！！！");
//        logger.error("这里是error级别！！！");
//
//    }

//    @Test
//    public void test(){
//        admin ad = new admin(null,"cheese","123456","芝士","thecheesesea@163.com",null);
//        int count = adminMapper.insert(ad);
//        System.out.println("受影响的行数"+count);
//    }

//    @Test
//    public void test() throws SQLException {
//        Connection connection = dataSource.getConnection();
//        System.out.println(connection);
//    }
}
